package cn.rkylin.oms.item.adapter;

import java.util.List;
import java.util.Map;

import cn.rkylin.oms.item.domain.Item;
import cn.rkylin.oms.system.shop.vo.ShopVO;

/**
 * 商品代理，负责与具体的电商平台对接
 * 
 * @author jipengcheng
 * @version 1.0
 * @created 2017.02.13
 */
public abstract class ItemVisitor {

    /**
     * 构造函数
     */
    public ItemVisitor() {

    }

    /**
     * 店铺
     */
    protected ShopVO shopVO;

    /**
     * 获取商品
     */
    public abstract List<Item> getItemListByItemCode(String shopId, Map<String, Object> paramMap) throws Exception;

    /**
     * 获取商品
     */
    public abstract List<Item> getItemListByModifyTime(String shopId, Map<String, Object> paramMap) throws Exception;

    /**
     * 获取商品
     */
    public abstract List<Item> getItemListAll(String shopId) throws Exception;
    
    /**
     * 手动同步库存根据商品
     * 
     * @param ecItemId
     * @return 错误消息
     * @throws Exception
     *             异常
     */
    public abstract String manualSynchStockByItem(String ecItemId) throws Exception;
    
    /**
     * 手动同步库存根据SKU
     * 
     * @param ecSkuId
     * @return 错误消息
     * @throws Exception
     *             异常
     */
    public abstract String manualSynchStockBySku(String ecSkuId) throws Exception;

    /**
     * 自动同步店铺库存并上下架
     * 
     * @param shopId
     * @return 错误消息
     * @throws Exception
     *             异常
     */
    public abstract String autoSynchStock(String shopId) throws Exception;

    public void finalize() throws Throwable {

    }

    public ShopVO getShopVO() {
        return shopVO;
    }

    public void setShopVO(ShopVO shopVO) {
        this.shopVO = shopVO;
    }

}
